Integrand size = 32, antiderivative size = 416 \[ \int \frac {A+B x}{\left (a+b x+c x^2\right ) \sqrt {d+e x+f x^2}} \, dx=\frac {\left (b B-2 A c-B \sqrt {b^2-4 a c}\right ) \text {arctanh}\left (\frac {4 c d-\left (b-\sqrt {b^2-4 a c}\right ) e+2 \left (c e-\left (b-\sqrt {b^2-4 a c}\right ) f\right ) x}{2 \sqrt {2} \sqrt {2 c^2 d-b c e+b^2 f-2 a c f+\sqrt {b^2-4 a c} (c e-b f)} \sqrt {d+e x+f x^2}}\right )}{\sqrt {2} \sqrt {b^2-4 a c} \sqrt {2 c^2 d-b c e+b^2 f-2 a c f+\sqrt {b^2-4 a c} (c e-b f)}}+\frac {\left (2 A c-B \left (b+\sqrt {b^2-4 a c}\right )\right ) \text {arctanh}\left (\frac {4 c d-\left (b+\sqrt {b^2-4 a c}\right ) e+2 \left (c e-\left (b+\sqrt {b^2-4 a c}\right ) f\right ) x}{2 \sqrt {2} \sqrt {2 c^2 d-b c e+b^2 f-2 a c f-\sqrt {b^2-4 a c} (c e-b f)} \sqrt {d+e x+f x^2}}\right )}{\sqrt {2} \sqrt {b^2-4 a c} \sqrt {2 c^2 d-b c e+b^2 f-2 a c f-\sqrt {b^2-4 a c} (c e-b f)}} \]
[Out]
Time = 1.74 (sec) , antiderivative size = 416, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.094, Rules used = {1046, 738, 212} \[ \int \frac {A+B x}{\left (a+b x+c x^2\right ) \sqrt {d+e x+f x^2}} \, dx=\frac {\left (-B \sqrt {b^2-4 a c}-2 A c+b B\right ) \text {arctanh}\left (\frac {2 x \left (c e-f \left (b-\sqrt {b^2-4 a c}\right )\right )-e \left (b-\sqrt {b^2-4 a c}\right )+4 c d}{2 \sqrt {2} \sqrt {d+e x+f x^2} \sqrt {\sqrt {b^2-4 a c} (c e-b f)-2 a c f+b^2 f-b c e+2 c^2 d}}\right )}{\sqrt {2} \sqrt {b^2-4 a c} \sqrt {\sqrt {b^2-4 a c} (c e-b f)-2 a c f+b^2 f-b c e+2 c^2 d}}+\frac {\left (2 A c-B \left (\sqrt {b^2-4 a c}+b\right )\right ) \text {arctanh}\left (\frac {2 x \left (c e-f \left (\sqrt {b^2-4 a c}+b\right )\right )-e \left (\sqrt {b^2-4 a c}+b\right )+4 c d}{2 \sqrt {2} \sqrt {d+e x+f x^2} \sqrt {-\sqrt {b^2-4 a c} (c e-b f)-2 a c f+b^2 f-b c e+2 c^2 d}}\right )}{\sqrt {2} \sqrt {b^2-4 a c} \sqrt {-\sqrt {b^2-4 a c} (c e-b f)-2 a c f+b^2 f-b c e+2 c^2 d}} \]
[In]
[Out]
Rule 212
Rule 738
Rule 1046
Rubi steps \begin{align*} \text {integral}& = \frac {\left (2 A c-B \left (b-\sqrt {b^2-4 a c}\right )\right ) \int \frac {1}{\left (b-\sqrt {b^2-4 a c}+2 c x\right ) \sqrt {d+e x+f x^2}} \, dx}{\sqrt {b^2-4 a c}}-\frac {\left (2 A c-B \left (b+\sqrt {b^2-4 a c}\right )\right ) \int \frac {1}{\left (b+\sqrt {b^2-4 a c}+2 c x\right ) \sqrt {d+e x+f x^2}} \, dx}{\sqrt {b^2-4 a c}} \\ & = \frac {\left (2 \left (b B-2 A c-B \sqrt {b^2-4 a c}\right )\right ) \text {Subst}\left (\int \frac {1}{16 c^2 d-8 c \left (b-\sqrt {b^2-4 a c}\right ) e+4 \left (b-\sqrt {b^2-4 a c}\right )^2 f-x^2} \, dx,x,\frac {4 c d-\left (b-\sqrt {b^2-4 a c}\right ) e-\left (-2 c e+2 \left (b-\sqrt {b^2-4 a c}\right ) f\right ) x}{\sqrt {d+e x+f x^2}}\right )}{\sqrt {b^2-4 a c}}+\frac {\left (2 \left (2 A c-B \left (b+\sqrt {b^2-4 a c}\right )\right )\right ) \text {Subst}\left (\int \frac {1}{16 c^2 d-8 c \left (b+\sqrt {b^2-4 a c}\right ) e+4 \left (b+\sqrt {b^2-4 a c}\right )^2 f-x^2} \, dx,x,\frac {4 c d-\left (b+\sqrt {b^2-4 a c}\right ) e-\left (-2 c e+2 \left (b+\sqrt {b^2-4 a c}\right ) f\right ) x}{\sqrt {d+e x+f x^2}}\right )}{\sqrt {b^2-4 a c}} \\ & = \frac {\left (b B-2 A c-B \sqrt {b^2-4 a c}\right ) \tanh ^{-1}\left (\frac {4 c d-\left (b-\sqrt {b^2-4 a c}\right ) e+2 \left (c e-\left (b-\sqrt {b^2-4 a c}\right ) f\right ) x}{2 \sqrt {2} \sqrt {2 c^2 d-b c e+b^2 f-2 a c f+\sqrt {b^2-4 a c} (c e-b f)} \sqrt {d+e x+f x^2}}\right )}{\sqrt {2} \sqrt {b^2-4 a c} \sqrt {2 c^2 d-b c e+b^2 f-2 a c f+\sqrt {b^2-4 a c} (c e-b f)}}+\frac {\left (2 A c-B \left (b+\sqrt {b^2-4 a c}\right )\right ) \tanh ^{-1}\left (\frac {4 c d-\left (b+\sqrt {b^2-4 a c}\right ) e+2 \left (c e-\left (b+\sqrt {b^2-4 a c}\right ) f\right ) x}{2 \sqrt {2} \sqrt {2 c^2 d-b c e+b^2 f-2 a c f-\sqrt {b^2-4 a c} (c e-b f)} \sqrt {d+e x+f x^2}}\right )}{\sqrt {2} \sqrt {b^2-4 a c} \sqrt {2 c^2 d-b c e+b^2 f-2 a c f-\sqrt {b^2-4 a c} (c e-b f)}} \\ \end{align*}
Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.
Time = 0.44 (sec) , antiderivative size = 278, normalized size of antiderivative = 0.67 \[ \int \frac {A+B x}{\left (a+b x+c x^2\right ) \sqrt {d+e x+f x^2}} \, dx=-\text {RootSum}\left [c d^2-b d e+a e^2+2 b d \sqrt {f} \text {$\#$1}-4 a e \sqrt {f} \text {$\#$1}-2 c d \text {$\#$1}^2+b e \text {$\#$1}^2+4 a f \text {$\#$1}^2-2 b \sqrt {f} \text {$\#$1}^3+c \text {$\#$1}^4\&,\frac {B d \log \left (-\sqrt {f} x+\sqrt {d+e x+f x^2}-\text {$\#$1}\right )-A e \log \left (-\sqrt {f} x+\sqrt {d+e x+f x^2}-\text {$\#$1}\right )+2 A \sqrt {f} \log \left (-\sqrt {f} x+\sqrt {d+e x+f x^2}-\text {$\#$1}\right ) \text {$\#$1}-B \log \left (-\sqrt {f} x+\sqrt {d+e x+f x^2}-\text {$\#$1}\right ) \text {$\#$1}^2}{b d \sqrt {f}-2 a e \sqrt {f}-2 c d \text {$\#$1}+b e \text {$\#$1}+4 a f \text {$\#$1}-3 b \sqrt {f} \text {$\#$1}^2+2 c \text {$\#$1}^3}\&\right ] \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(804\) vs. \(2(370)=740\).
Time = 1.01 (sec) , antiderivative size = 805, normalized size of antiderivative = 1.94
method | result | size |
default | \(-\frac {\left (-2 A c +B \sqrt {-4 a c +b^{2}}+B b \right ) \ln \left (\frac {-\frac {-\sqrt {-4 a c +b^{2}}\, b f +c e \sqrt {-4 a c +b^{2}}+2 a c f -b^{2} f +b c e -2 c^{2} d}{c^{2}}-\frac {\left (f \sqrt {-4 a c +b^{2}}+b f -c e \right ) \left (x +\frac {b +\sqrt {-4 a c +b^{2}}}{2 c}\right )}{c}+\frac {\sqrt {-\frac {2 \left (-\sqrt {-4 a c +b^{2}}\, b f +c e \sqrt {-4 a c +b^{2}}+2 a c f -b^{2} f +b c e -2 c^{2} d \right )}{c^{2}}}\, \sqrt {4 f {\left (x +\frac {b +\sqrt {-4 a c +b^{2}}}{2 c}\right )}^{2}-\frac {4 \left (f \sqrt {-4 a c +b^{2}}+b f -c e \right ) \left (x +\frac {b +\sqrt {-4 a c +b^{2}}}{2 c}\right )}{c}-\frac {2 \left (-\sqrt {-4 a c +b^{2}}\, b f +c e \sqrt {-4 a c +b^{2}}+2 a c f -b^{2} f +b c e -2 c^{2} d \right )}{c^{2}}}}{2}}{x +\frac {b +\sqrt {-4 a c +b^{2}}}{2 c}}\right )}{\sqrt {-4 a c +b^{2}}\, c \sqrt {-\frac {2 \left (-\sqrt {-4 a c +b^{2}}\, b f +c e \sqrt {-4 a c +b^{2}}+2 a c f -b^{2} f +b c e -2 c^{2} d \right )}{c^{2}}}}-\frac {\left (2 A c +B \sqrt {-4 a c +b^{2}}-B b \right ) \ln \left (\frac {-\frac {\sqrt {-4 a c +b^{2}}\, b f -c e \sqrt {-4 a c +b^{2}}+2 a c f -b^{2} f +b c e -2 c^{2} d}{c^{2}}-\frac {\left (-f \sqrt {-4 a c +b^{2}}+b f -c e \right ) \left (x -\frac {-b +\sqrt {-4 a c +b^{2}}}{2 c}\right )}{c}+\frac {\sqrt {-\frac {2 \left (\sqrt {-4 a c +b^{2}}\, b f -c e \sqrt {-4 a c +b^{2}}+2 a c f -b^{2} f +b c e -2 c^{2} d \right )}{c^{2}}}\, \sqrt {4 f {\left (x -\frac {-b +\sqrt {-4 a c +b^{2}}}{2 c}\right )}^{2}-\frac {4 \left (-f \sqrt {-4 a c +b^{2}}+b f -c e \right ) \left (x -\frac {-b +\sqrt {-4 a c +b^{2}}}{2 c}\right )}{c}-\frac {2 \left (\sqrt {-4 a c +b^{2}}\, b f -c e \sqrt {-4 a c +b^{2}}+2 a c f -b^{2} f +b c e -2 c^{2} d \right )}{c^{2}}}}{2}}{x -\frac {-b +\sqrt {-4 a c +b^{2}}}{2 c}}\right )}{\sqrt {-4 a c +b^{2}}\, c \sqrt {-\frac {2 \left (\sqrt {-4 a c +b^{2}}\, b f -c e \sqrt {-4 a c +b^{2}}+2 a c f -b^{2} f +b c e -2 c^{2} d \right )}{c^{2}}}}\) | \(805\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 22103 vs. \(2 (369) = 738\).
Time = 277.46 (sec) , antiderivative size = 22103, normalized size of antiderivative = 53.13 \[ \int \frac {A+B x}{\left (a+b x+c x^2\right ) \sqrt {d+e x+f x^2}} \, dx=\text {Too large to display} \]
[In]
[Out]
\[ \int \frac {A+B x}{\left (a+b x+c x^2\right ) \sqrt {d+e x+f x^2}} \, dx=\int \frac {A + B x}{\left (a + b x + c x^{2}\right ) \sqrt {d + e x + f x^{2}}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {A+B x}{\left (a+b x+c x^2\right ) \sqrt {d+e x+f x^2}} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
Exception generated. \[ \int \frac {A+B x}{\left (a+b x+c x^2\right ) \sqrt {d+e x+f x^2}} \, dx=\text {Exception raised: TypeError} \]
[In]
[Out]
Timed out. \[ \int \frac {A+B x}{\left (a+b x+c x^2\right ) \sqrt {d+e x+f x^2}} \, dx=\int \frac {A+B\,x}{\left (c\,x^2+b\,x+a\right )\,\sqrt {f\,x^2+e\,x+d}} \,d x \]
[In]
[Out]